

<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>pymatgen.analysis.solar package &mdash; pymatgen 2025.6.14 documentation</title>
      <link rel="stylesheet" type="text/css" href="assets/pygments.css?v=03e43079" />
      <link rel="stylesheet" type="text/css" href="assets/css/theme.css?v=e59714d7" />
      <link rel="stylesheet" type="text/css" href="assets/css/custom.css" />

  
    <link rel="canonical" href="https://pymatgen.orgpymatgen.analysis.solar.html"/>
      <script src="assets/jquery.js?v=5d32c60e"></script>
      <script src="assets/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="assets/documentation_options.js?v=03bec786"></script>
      <script src="assets/doctools.js?v=9bcbadda"></script>
      <script src="assets/sphinx_highlight.js?v=dc90522c"></script>
    <script src="assets/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >

          
          
          <a href="index.html">
            
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <!-- Local TOC -->
              <div class="local-toc"><ul>
<li><a class="reference internal" href="#">pymatgen.analysis.solar package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-pymatgen.analysis.solar.slme">pymatgen.analysis.solar.slme module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.solar.slme.absorption_coefficient"><code class="docutils literal notranslate"><span class="pre">absorption_coefficient()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.solar.slme.get_dir_indir_gap"><code class="docutils literal notranslate"><span class="pre">get_dir_indir_gap()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.solar.slme.optics"><code class="docutils literal notranslate"><span class="pre">optics()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.solar.slme.parse_dielectric_data"><code class="docutils literal notranslate"><span class="pre">parse_dielectric_data()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.solar.slme.slme"><code class="docutils literal notranslate"><span class="pre">slme()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.solar.slme.to_matrix"><code class="docutils literal notranslate"><span class="pre">to_matrix()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">pymatgen</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content style-external-links">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">pymatgen.analysis.solar package</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.analysis.solar.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="module-pymatgen.analysis.solar">
<span id="pymatgen-analysis-solar-package"></span><h1>pymatgen.analysis.solar package<a class="headerlink" href="#module-pymatgen.analysis.solar" title="Link to this heading"></a></h1>
<p>Module for predicting theoretical solar-cell efficiency.</p>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Link to this heading"></a></h2>
</section>
<section id="module-pymatgen.analysis.solar.slme">
<span id="pymatgen-analysis-solar-slme-module"></span><h2>pymatgen.analysis.solar.slme module<a class="headerlink" href="#module-pymatgen.analysis.solar.slme" title="Link to this heading"></a></h2>
<p>Calculate spectroscopy limited maximum efficiency (SLME) given dielectric function data.</p>
<p>Forked and adjusted from :
<a class="reference external" href="https://github.com/usnistgov/jarvis">https://github.com/usnistgov/jarvis</a></p>
<dl class="simple">
<dt>References: 1) <a class="reference external" href="https://doi.org/10.1021/acs.chemmater.9b02166">https://doi.org/10.1021/acs.chemmater.9b02166</a>  &amp;</dt><dd><ol class="arabic simple" start="2">
<li><p><a class="reference external" href="https://doi.org/10.1103/PhysRevLett.108.068701">https://doi.org/10.1103/PhysRevLett.108.068701</a></p></li>
</ol>
</dd>
</dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.solar.slme.absorption_coefficient">
<span class="sig-name descname"><span class="pre">absorption_coefficient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dielectric</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/solar/slme.py#L87-L117"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.solar.slme.absorption_coefficient" title="Link to this definition"></a></dt>
<dd><p>Calculate the optical absorption coefficient from an input set of
pymatgen vasprun dielectric constant data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>dielectric</strong> (<em>list</em>) – A list containing the dielectric response function
in the pymatgen vasprun format.
- element 0: list of energies
- element 1: real dielectric tensors, in <code class="docutils literal notranslate"><span class="pre">[xx,</span> <span class="pre">yy,</span> <span class="pre">zz,</span> <span class="pre">xy,</span> <span class="pre">xz,</span> <span class="pre">yz]</span></code> format.
- element 2: imaginary dielectric tensors, in <code class="docutils literal notranslate"><span class="pre">[xx,</span> <span class="pre">yy,</span> <span class="pre">zz,</span> <span class="pre">xy,</span> <span class="pre">xz,</span> <span class="pre">yz]</span></code> format.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>absorption coefficient using eV as frequency units (cm^-1).</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>np.ndarray</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.solar.slme.get_dir_indir_gap">
<span class="sig-name descname"><span class="pre">get_dir_indir_gap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">run</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/solar/slme.py#L43-L49"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.solar.slme.get_dir_indir_gap" title="Link to this definition"></a></dt>
<dd><p>Get direct and indirect bandgaps for a vasprun.xml.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.solar.slme.optics">
<span class="sig-name descname"><span class="pre">optics</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/solar/slme.py#L120-L131"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.solar.slme.optics" title="Link to this definition"></a></dt>
<dd><p>Helper function to calculate optical absorption coefficient.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.solar.slme.parse_dielectric_data">
<span class="sig-name descname"><span class="pre">parse_dielectric_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/solar/slme.py#L71-L84"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.solar.slme.parse_dielectric_data" title="Link to this definition"></a></dt>
<dd><p>Convert a set of 2D vasprun formatted dielectric data to
the eigenvalues of each corresponding 3x3 symmetric numpy matrices.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data</strong> (<em>list</em>) – length N list of dielectric data. Each entry should be
a list of <code class="docutils literal notranslate"><span class="pre">[xx,</span> <span class="pre">yy,</span> <span class="pre">zz,</span> <span class="pre">xy</span> <span class="pre">,</span> <span class="pre">xz,</span> <span class="pre">yz</span> <span class="pre">]</span></code> dielectric tensor elements.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>a Nx3 numpy array. Each row contains the eigenvalues</dt><dd><p>for the corresponding row in <cite>data</cite>.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>np.ndarray</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.solar.slme.slme">
<span class="sig-name descname"><span class="pre">slme</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">material_energy_for_absorbance_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">material_absorbance_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">material_direct_allowed_gap</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">material_indirect_gap</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">thickness</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5e-05</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">temperature</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">293.15</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">absorbance_in_inverse_centimeters</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cut_off_absorbance_below_direct_allowed_gap</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">plot_current_voltage</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/solar/slme.py#L134-L275"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.solar.slme.slme" title="Link to this definition"></a></dt>
<dd><p>Calculate the SLME.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>material_energy_for_absorbance_data</strong> – energy grid for absorbance data</p></li>
<li><p><strong>material_absorbance_data</strong> – absorption coefficient in m^-1</p></li>
<li><p><strong>material_direct_allowed_gap</strong> – direct bandgap in eV</p></li>
<li><p><strong>material_indirect_gap</strong> – indirect bandgap in eV</p></li>
<li><p><strong>thickness</strong> – thickness of the material in m</p></li>
<li><p><strong>temperature</strong> – working temperature in K</p></li>
<li><p><strong>absorbance_in_inverse_centimeters</strong> – whether the absorbance data is in the unit of cm^-1</p></li>
<li><p><strong>cut_off_absorbance_below_direct_allowed_gap</strong> – whether to discard all absorption below bandgap</p></li>
<li><p><strong>plot_current_voltage</strong> – whether to plot the current-voltage curve</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The calculated maximum efficiency.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.solar.slme.to_matrix">
<span class="sig-name descname"><span class="pre">to_matrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yy</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zz</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xy</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yz</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xz</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/solar/slme.py#L52-L68"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.solar.slme.to_matrix" title="Link to this definition"></a></dt>
<dd><p>Convert a list of matrix components to a symmetric 3x3 matrix.
Inputs should be in the order xx, yy, zz, xy, yz, xz.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong> (<em>float</em>) – xx component of the matrix.</p></li>
<li><p><strong>yy</strong> (<em>float</em>) – yy component of the matrix.</p></li>
<li><p><strong>zz</strong> (<em>float</em>) – zz component of the matrix.</p></li>
<li><p><strong>xy</strong> (<em>float</em>) – xy component of the matrix.</p></li>
<li><p><strong>yz</strong> (<em>float</em>) – yz component of the matrix.</p></li>
<li><p><strong>xz</strong> (<em>float</em>) – xz component of the matrix.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The matrix, as a 3x3 numpy array.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>np.ndarray</p>
</dd>
</dl>
</dd></dl>

</section>
</section>


           </div>
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2011, Pymatgen Development Team.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>
